/*
 * @Author: 莫宗蓝 mozl@augurit.com
 * @Date: 2022-07-04 16:27:47
 * @LastEditors: 莫宗蓝 mozl@augurit.com
 * @LastEditTime: 2022-07-15 16:54:53
 * @FilePath: \agcim-viewer\src\widgets\ProjectOnWater\js\WaterPrimitiveCollection.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
export default class WaterPrimitiveCollection {
    constructor() {
        this.collection = [];
    }
    addPrimitive(waterPrimitive) {
        this.collection.push(waterPrimitive);
    }
    getPrimitives(){
        let primitives = [];
        if(this.collection.length>0){
            this.collection.forEach(primitive=>{
                let _primitive = primitive.getPrimitive();
                primitives.push(_primitive);
            })
        }
        return primitives;
    }
    destroy() {
        this.collection.forEach(primitive => {
            primitive.destroy();
        })
    }
}